{% extends "base.html" %}

{% block submenu %}
<p> <div class="submenu"> <a href="/tasktracker/category/new/">New</a>&nbsp;::&nbsp;</div></p>    
{% endblock %} 


{% block search_form %}
<div class="search">
    <form action="/tasktracker/category/" method="POST">
        <input type="text" name="search" size=60/>
        <input type="submit" value="Search"/>
    </form>
</div>
{% endblock %}

{% block categories %}



<div class="table">
<table>
<tr>
    <th class="table">Code</th>
    <th class="table">Description</th>
    <th class="table">Tasks</th>
    <th class="table">Open</th>
    <th class="table">Closed</th>
    <th class="table">Actions</th>
</tr>
{% for category in categories %}
        <tr class="{% cycle 'row1' 'row2'%}" >
            <td class="table"><a href="/tasktracker/task/category/{{ category.id }}/"> {{ category.code }} </a></td> 
            <td class="table">{{ category.description }}</td>
            <td class="table">{{ category.total_tasks }}</td>
            <td class="table">{{ category.open_tasks }}</td>
            <td class="table">{{ category.closed_tasks }}</td>
            <td class="table">
                <a href="/tasktracker/category/{{ category.id }}/edit/">Edit<a/> &nbsp;
                <a href="/tasktracker/category/{{ category.id }}/delete/">Delete<a/>
            </td>
       </tr>
    </div>
{% endfor %}
</table>
{% endblock %}
